package com.zh.admin.product.service.Impl;

import com.zh.admin.product.dao.ProductsAdminDao;
import com.zh.admin.product.service.ProductsAdminService;
import com.zh.pojo.Products;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * company: www.abc.com
 * Author: Administrator
 * Create Data: 2021/5/28 0028
 */
@Service
public class ProductsAdminAdminServiceImpl implements ProductsAdminService {

    @Resource
    private ProductsAdminDao productsAdminDao;

    @Override
    public int insertProducts(Products products) {
        return productsAdminDao.insertProducts(products);
    }

    @Override
    public int updateProducts(Products products) {
        return productsAdminDao.updateProducts(products);
    }

    @Override
    public int deleteProductsById(String id) {
        return productsAdminDao.deleteProductsById(id);
    }

    @Override
    public List<Products> selectProductsAll() {
//        System.out.println("all");
        return productsAdminDao.selectProductsAll();
    }

    @Override
    public Products selectProductsById(String id) {
        return productsAdminDao.selectProductsById(id);
    }

    @Override
    public List<Products> selectProductsCondition(Products products, double minprice, double maxprice) {
//        System.out.println("yes");
//        System.out.println("service -- "+products+" -- "+minprice+" -- "+maxprice);
        return productsAdminDao.selectProductsCondition(products,minprice,maxprice);
    }

    @Override
    public List<Products> selectHotData(Integer year, Integer month) {
        return productsAdminDao.selectHotData(year,month);
    }

}
